import 'package:flutter/material.dart';
import 'package:getwidget/components/image/gf_image_overlay.dart';
import 'package:meal/constant/fonts.dart';
import 'package:meal/constant/sizes.dart';
import 'package:meal/utils/colors.dart';
import 'package:meal/utils/styles.dart';
import 'package:meal/utils/tools.dart';

class SnapshotInfo extends StatefulWidget {
  const SnapshotInfo({Key? key}) : super(key: key);

  @override
  State<StatefulWidget> createState() => _SnapshotInfoState();
}

class _SnapshotInfoState extends State {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: ToolsUtils.getDefaultBackgroundColor(),
      appBar: ToolsUtils.getDefaultBrnAppBar('交易快照'),
      body: SingleChildScrollView(
        child: Column(
          children: [
            const GFImageOverlay(
              height: 375,
              image:
                  NetworkImage('https://cdn7.axureshop.com/demo/1525603/images/团购快照详情/u3784.png'),
            ),
            Container(
              margin: const EdgeInsets.all(Sizes.default20),
              decoration: BoxDecoration(
                  color: Colors.white, borderRadius: BorderRadius.circular(Sizes.default10)),
              padding: const EdgeInsets.symmetric(
                  vertical: Sizes.default10, horizontal: Sizes.default15),
              child: ListBody(
                children: [
                  Container(
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '香辣鸡排汉堡双人套餐',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333,
                          fontSize: Sizes.default20,
                          fontWeight: Fonts.w7),
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: Sizes.default15, bottom: Sizes.default10),
                    alignment: Alignment.centerLeft,
                    child: Text.rich(TextSpan(
                        text: '服务 ',
                        style: StylesUtils.customTextStyle(
                            color: '#FF644D', fontSize: Sizes.default13),
                        children: [
                          TextSpan(
                              text: '随时退 · 过期退 · 推荐自提',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color333, fontSize: Sizes.default12))
                        ])),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    child: Text.rich(TextSpan(
                        text: '限购 ',
                        style: StylesUtils.customTextStyle(color: '#FF644D'),
                        children: [
                          TextSpan(
                              text: '每单限购10件',
                              style: StylesUtils.customTextStyle(
                                  color: ColorsUtils.color333, fontSize: Sizes.default13))
                        ])),
                  ),
                  Container(
                    margin: const EdgeInsets.only(top: Sizes.default20, bottom: Sizes.default20),
                    alignment: Alignment.centerLeft,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Wrap(
                          spacing: Sizes.default8,
                          children: [
                            Text(
                              '￥687',
                              style: StylesUtils.customTextStyle(
                                  fontSize: Sizes.default25, color: '#ff644d'),
                            ),
                            Text(
                              '￥840',
                              style: TextStyle(
                                  fontWeight: Fonts.w4,
                                  fontFamily: Fonts.yaHei,
                                  fontSize: Sizes.default14,
                                  color: ColorsUtils.parseColorFromHexString(ColorsUtils.color999),
                                  decorationColor:
                                      ColorsUtils.parseColorFromHexString(ColorsUtils.color999),
                                  decoration: TextDecoration.lineThrough,
                                  decorationStyle: TextDecorationStyle.solid),
                            ),
                            Container(
                              alignment: Alignment.center,
                              constraints:
                                  const BoxConstraints.expand(width: 35, height: Sizes.default18),
                              decoration: BoxDecoration(
                                  border: Border.all(
                                    color: ColorsUtils.rgba(255, 100, 77, 1),
                                  ),
                                  borderRadius: BorderRadius.circular(Sizes.default3)),
                              child: Text(
                                '7.1折',
                                style: StylesUtils.customTextStyle(
                                    color: '#FF644D', fontSize: Sizes.default12),
                              ),
                            )
                          ],
                        ),
                        Text(
                          '已售5万份',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color999, fontSize: Sizes.default12),
                        )
                      ],
                    ),
                  ),
                  Row(
                    children: [
                      Expanded(
                          child: Row(
                        children: [
                          ToolsUtils.getAssetImage('shop_icon.jpg',
                              width: Sizes.default20, height: Sizes.default20),
                          Expanded(
                              child: Text(
                            '华莱士·全鸡汉堡-凤凰广场',
                            overflow: TextOverflow.ellipsis,
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.color333, fontSize: Sizes.default12),
                          ))
                        ],
                      )),
                      Expanded(
                          child: Wrap(
                        spacing: Sizes.default10,
                        children: [
                          Text(
                            '4.5分',
                            style: StylesUtils.customTextStyle(
                                color: '#FF6600', fontSize: Sizes.default12),
                          ),
                          Text(
                            '人均￥240',
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.color797, fontSize: Sizes.default12),
                          ),
                          Text(
                            '2.5km',
                            style: StylesUtils.customTextStyle(
                                color: ColorsUtils.color666, fontSize: Sizes.default12),
                          )
                        ],
                      )),
                    ],
                  )
                ],
              ),
            ),
            Container(
              margin: const EdgeInsets.only(
                  left: Sizes.default20, right: Sizes.default20, bottom: Sizes.default20),
              decoration: BoxDecoration(
                  color: Colors.white, borderRadius: BorderRadius.circular(Sizes.default10)),
              padding: const EdgeInsets.symmetric(
                  vertical: Sizes.default10, horizontal: Sizes.default15),
              child: ListBody(
                children: [
                  Container(
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '商品内容',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333,
                          fontSize: Sizes.default15,
                          fontWeight: Fonts.w7),
                    ),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    margin: const EdgeInsets.symmetric(vertical: Sizes.default15),
                    child: Text(
                      '主菜 · 4选2 (不可重复选)',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333,
                          fontSize: Sizes.default13,
                          fontWeight: Fonts.w7),
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(bottom: Sizes.default10),
                    alignment: Alignment.centerLeft,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text.rich(TextSpan(
                            text: '·  火焰牛排',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color000,
                            ),
                            children: [
                              TextSpan(
                                  text: '（1份）',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color999, fontSize: Sizes.default13))
                            ])),
                        Text(
                          '￥240',
                          style: StylesUtils.customTextStyle(color: ColorsUtils.color333),
                        )
                      ],
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(bottom: Sizes.default10),
                    alignment: Alignment.centerLeft,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text.rich(TextSpan(
                            text: '·  烤鸡肉披萨',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color000,
                            ),
                            children: [
                              TextSpan(
                                  text: '（1份）',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color999, fontSize: Sizes.default13))
                            ])),
                        Text(
                          '￥240',
                          style: StylesUtils.customTextStyle(color: ColorsUtils.color333),
                        )
                      ],
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(bottom: Sizes.default10),
                    alignment: Alignment.centerLeft,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text.rich(TextSpan(
                            text: '·  西冷牛排',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color000,
                            ),
                            children: [
                              TextSpan(
                                  text: '（1份）',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color999, fontSize: Sizes.default13))
                            ])),
                        Text(
                          '￥240',
                          style: StylesUtils.customTextStyle(color: ColorsUtils.color333),
                        )
                      ],
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(bottom: Sizes.default10),
                    alignment: Alignment.centerLeft,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text.rich(TextSpan(
                            text: '·  菲力牛排',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color000,
                            ),
                            children: [
                              TextSpan(
                                  text: '（1份）',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color999, fontSize: Sizes.default13))
                            ])),
                        Text(
                          '￥240',
                          style: StylesUtils.customTextStyle(color: ColorsUtils.color333),
                        )
                      ],
                    ),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text.rich(TextSpan(
                            text: '·  黄标牛排',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color000,
                            ),
                            children: [
                              TextSpan(
                                  text: '（1份）',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color999, fontSize: Sizes.default13))
                            ])),
                        Text(
                          '￥240',
                          style: StylesUtils.customTextStyle(color: ColorsUtils.color333),
                        )
                      ],
                    ),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    margin: const EdgeInsets.symmetric(vertical: Sizes.default15),
                    child: Text(
                      '小吃 · 2选1',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333,
                          fontSize: Sizes.default13,
                          fontWeight: Fonts.w7),
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(bottom: Sizes.default10),
                    alignment: Alignment.centerLeft,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text.rich(TextSpan(
                            text: '·  香酥藤辣鸡块',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color000,
                            ),
                            children: [
                              TextSpan(
                                  text: '（1份）',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color999, fontSize: Sizes.default13))
                            ])),
                        Text(
                          '￥240',
                          style: StylesUtils.customTextStyle(color: ColorsUtils.color333),
                        )
                      ],
                    ),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text.rich(TextSpan(
                            text: '·  美式粗薯条',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color000,
                            ),
                            children: [
                              TextSpan(
                                  text: '（1份）',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color999, fontSize: Sizes.default13))
                            ])),
                        Text(
                          '￥240',
                          style: StylesUtils.customTextStyle(color: ColorsUtils.color333),
                        )
                      ],
                    ),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    margin: const EdgeInsets.symmetric(vertical: Sizes.default15),
                    child: Text(
                      '饮品',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333,
                          fontSize: Sizes.default13,
                          fontWeight: Fonts.w7),
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(bottom: Sizes.default10),
                    alignment: Alignment.centerLeft,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text.rich(TextSpan(
                            text: '·  金桔爆宁',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color000,
                            ),
                            children: [
                              TextSpan(
                                  text: '（1份）',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color999, fontSize: Sizes.default13))
                            ])),
                        Text(
                          '￥240',
                          style: StylesUtils.customTextStyle(color: ColorsUtils.color333),
                        )
                      ],
                    ),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Text.rich(TextSpan(
                            text: '·  嫣红鲜奶茶',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color000,
                            ),
                            children: [
                              TextSpan(
                                  text: '（1份）',
                                  style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color999, fontSize: Sizes.default13))
                            ])),
                        Text(
                          '￥240',
                          style: StylesUtils.customTextStyle(color: ColorsUtils.color333),
                        )
                      ],
                    ),
                  ),
                ],
              ),
            ),
            Container(
              margin: const EdgeInsets.only(
                  left: Sizes.default20, right: Sizes.default20, bottom: Sizes.default20),
              decoration: BoxDecoration(
                  color: Colors.white, borderRadius: BorderRadius.circular(Sizes.default10)),
              padding: const EdgeInsets.symmetric(
                  vertical: Sizes.default10, horizontal: Sizes.default15),
              child: ListBody(
                children: [
                  Container(
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '商品规则',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333,
                          fontSize: Sizes.default15,
                          fontWeight: Fonts.w7),
                    ),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    margin: const EdgeInsets.only(top: Sizes.default15),
                    child: Text(
                      '活动时间',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333,
                          fontSize: Sizes.default13,
                          fontWeight: Fonts.w7),
                    ),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '2023-03-12 至 2023-09-15，商品可能因库存不足等原因提前下架',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333, fontSize: Sizes.default13, lineHeight: 1.5),
                    ),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    margin: const EdgeInsets.only(top: Sizes.default15),
                    child: Text(
                      '有效期',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333,
                          fontSize: Sizes.default13,
                          fontWeight: Fonts.w7),
                    ),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '· 周一至周五  (全天)',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333, fontSize: Sizes.default13, lineHeight: 1.5),
                    ),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    margin: const EdgeInsets.only(top: Sizes.default15),
                    child: Text(
                      '限购数量',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333,
                          fontSize: Sizes.default13,
                          fontWeight: Fonts.w7),
                    ),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '· 每人每单限购10件',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333, fontSize: Sizes.default13, lineHeight: 1.5),
                    ),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    margin: const EdgeInsets.only(top: Sizes.default15),
                    child: Text(
                      '使用规则',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333,
                          fontSize: Sizes.default13,
                          fontWeight: Fonts.w7),
                    ),
                  ),
                  Container(
                    constraints: const BoxConstraints(minHeight: Sizes.default30),
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '·  该商品不可与商家其他优惠同享',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333, fontSize: Sizes.default13),
                    ),
                  ),
                  Container(
                    constraints: const BoxConstraints(minHeight: Sizes.default30),
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '·  酒水饮料等问题，请致电商家咨询，以商家反馈为准',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333, fontSize: Sizes.default13),
                    ),
                  ),
                  Container(
                    constraints: const BoxConstraints(minHeight: Sizes.default30),
                    alignment: Alignment.centerLeft,
                    margin: const EdgeInsets.only(bottom: Sizes.default10, top: Sizes.default10),
                    child: Text(
                      '·  如部分菜品因时令或其他不可抗因素导致无法提供，　商家会用等价菜品替换，具体事宜请与商家协商',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333, fontSize: Sizes.default13, lineHeight: 1.5),
                    ),
                  ),
                  Container(
                    constraints: const BoxConstraints(minHeight: Sizes.default30),
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '·  仅限到店堂食，不提供自提外带，不提供送餐',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333, fontSize: Sizes.default13),
                    ),
                  ),
                  Container(
                    alignment: Alignment.centerLeft,
                    margin: const EdgeInsets.only(top: Sizes.default15),
                    child: Text(
                      '商家服务',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333,
                          fontSize: Sizes.default13,
                          fontWeight: Fonts.w7),
                    ),
                  ),
                  Container(
                    constraints: const BoxConstraints(minHeight: Sizes.default30),
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '·  免预约',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333, fontSize: Sizes.default13),
                    ),
                  ),
                  Container(
                    constraints: const BoxConstraints(minHeight: Sizes.default30),
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '·  包间可用',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333, fontSize: Sizes.default13),
                    ),
                  ),
                  Container(
                    constraints: const BoxConstraints(minHeight: Sizes.default30),
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '·  免费WIFI',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333, fontSize: Sizes.default13),
                    ),
                  ),
                  Container(
                    constraints: const BoxConstraints(minHeight: Sizes.default30),
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '·  免费停车',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333, fontSize: Sizes.default13),
                    ),
                  ),
                  Container(
                    constraints: const BoxConstraints(minHeight: Sizes.default30),
                    alignment: Alignment.centerLeft,
                    child: Text(
                      '·  推荐自提',
                      style: StylesUtils.customTextStyle(
                          color: ColorsUtils.color333, fontSize: Sizes.default13),
                    ),
                  ),
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
}
